package com.shixi.shixitraining.shixitraining.ui.tabmine.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.RequestManager;
import com.shixi.shixitraining.shixitraining.R;
import com.shixi.shixitraining.shixitraining.test.TestCollectJobBean;
import com.shixi.shixitraining.shixitraining.ui.tabhome.activity.OverseaApplyActivity;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseAdapter;
import com.shixi.shixitraining.shixitraining.view.recycleview.BaseRecycleHolder;

import java.util.List;

/**
 * Created by shenyan on 2018/7/27.
 */

public class CollectJobAdapter extends BaseAdapter<TestCollectJobBean> {

    private  RequestManager manager;
    public CollectJobAdapter(Context context, List<TestCollectJobBean> data, RequestManager manager) {
        super(context, data);
        this.manager=manager;
    }

    @Override
    public void convert(BaseRecycleHolder holder, TestCollectJobBean item, int position) {
        holder.setText(R.id.collect_job_title_tv,item.getTitle());
        holder.setText(R.id.job_times_tv,item.getTimes());
        holder.setText(R.id.job_date_tv,item.getDate());
        holder.setText(R.id.job_collect_time_tv,item.getCollectTime());
        TextView mApply = holder.getView(R.id.job_apply);
        mApply.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, OverseaApplyActivity.class));
            }
        });

    }

    @Override
    protected int getLayoutId(int viewType) {
        return R.layout.adapter_mine_collect_job;
    }
}
